package com.ruoyi.project.task.receive.controller;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.task.mission.domain.TaskMission;
import com.ruoyi.project.task.mission.domain.TaskMissionVo;
import com.ruoyi.project.task.receive.service.ITaskReceiveService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author Pathosis
 * @date 2020-09-18 11:27
 * @description: 任务接收查看前端控制器
 */
@Controller
@RequestMapping("/task/receive")
public class TaskReceiveController extends BaseController{

    private String prefix = "task/receive";

    @Autowired
    private ITaskReceiveService itrs;

    @RequiresPermissions("task:receive:view")
    @GetMapping
    public String mission(){
        return prefix +"/receive";
    }

    @RequiresPermissions("task:receive:list")
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(TaskMissionVo taskMissionVo)
    {
        //分页
        startPage();

        List<TaskMissionVo> list = itrs.selectTaskMissionForTaskreceive(taskMissionVo);

        return getDataTable(list);
    }

}
